<template>
  <!-- 评价 -->
  <div>
    <el-form ref="form" :model="form" :rules="rules" class="dataForm">
      <el-row style="text-align: center; margin-left: 15px !important;">
        <el-col :span="24">
          <el-form-item prop="text">
            <el-input v-model="form.text" type="textarea" :autosize="{ minRows: 8, maxRows: 10}" maxlength="2000" show-word-limit :placeholder="$t('请填写评价!')" />
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <div slot="footer" class="dialog-footer" style="text-align: center;width: 100%;">
      <el-button type="primary" @click="submitForm">{{ $t('保存') }}</el-button>
    </div>
  </div>
</template>

<script>
export default {
  name: 'DealIndicatorDataEvaluate',
  data() {
    return {
      form: {
        text: ''
      },
      index: undefined,
      rules: {
        text: [{ required: true, message: this.$t('必填信息'), trigger: 'change' }]
      }
    }
  },
  computed: {},
  mounted() {
  },
  methods: {
    init() {},
    updateContext(data, index) {
      this.form.text = data.des
      this.index = index
    },
    submitForm() {
      this.$refs['form'].validate(valid => {
        if (valid) {
          this.$emit('updateContextByIndex', this.form.text, this.index)
          this.$parent.$parent.evaluateOpen = false
        } else {
          this.locationError(document)
        }
      })
    }
  }
}
</script>

<style scoped>

</style>
